package com.zyy.factory.simple;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/07/19 22:03
 */
public class Consumer {
    public static void main(String[] args) {
        //传统方式
//        Wuling car1 = new Wuling();
//        Tesla car2 = new Tesla();
        //方法一
//        Car car1 = CarFactory.getCar("五菱");
//        Car car2 = CarFactory.getCar("特斯拉");

        //方法二
        Car car1 = CarFactory.getWuling();
        Car car2 = CarFactory.getTesla();

        car1.name();
        car2.name();
    }
}
